<template>
<!--父传子参数应用-->
<ul>
    <li v-for="person in persons" :key="person.id">{{ person.name }} {{ person.age }}</li>
</ul>

</template>


<script setup lang="ts">
import type { Persons } from '@/types';

//只接收
// let props = defineProps(['persons'])
// console.log(props)
//接收限定类型的参数 + 限制必要性 + 指定默认值
withDefaults(defineProps<{persons?:Persons}>(), {
    persons: () => [{id:'xiao01',name:'zero',age:99}]
})  
</script>